package com.googlecode.gwtptk.client;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Displays alert on failure - positive scenario must be implemented in a subclass - mostly anonymous.
 *
 * @author Richard "Virgo" Richter (virgo47@gmail.com)
 */
public abstract class AlertAsyncCallback<T> implements AsyncCallback<T> {
	/**
	 * Shows alert window with the message from the throwable.
	 *
	 * @param caught caught throwable/exception
	 */
	@Override
	public void onFailure(Throwable caught) {
		Window.alert(caught.getMessage());
	}
}

